﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SMS_API_SENDER.Default" %>

<%@ Import Namespace="SMS_API_SENDER" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
    <%--<!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>--%>
    <style>
        #prettyResponseDiv
        {
            white-space: pre;
            font-family: monospace;
        }
        .commandTB
        {
            width: 200px;
        }
        form
        {
            padding: 18px;
        }
        .form-group
        {
            margin: 0 5px;
        }
    </style>
    <script>
        (function (i, s, o, g, r, a, m) {
            i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date(); a = s.createElement(o),
  m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
        })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

        ga('create', 'UA-59133401-1', 'auto');
        ga('send', 'pageview');

    </script>
</head>
<body>
    <form id="form1" runat="server" role="form">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(end_Update)
        function end_Update() {
            var jsonString = $('#responseHid').val();
            var obj = jQuery.parseJSON(jsonString);
            document.getElementById("prettyResponseDiv").innerHTML = "";
            document.getElementById("prettyResponseDiv").innerText = JSON.stringify(obj, null, 2);
        }
    </script>
    <div class="form-inline">
        <div class="form-group">
            <label for="userName">
                Brugernavn</label>
            <input type="text" id="userName" class="form-control" runat="server" value="" placeholder="jane.doe@example.com" />
        </div>
        <div class="form-group">
            <label for="password">
                Kodeord</label>
            <input type="password" class="form-control" id="password" runat="server" value="" />
        </div>
        <div class="form-group">
            <label for="targetNumber">
                Modtagernummer</label>
            <input type="text" class="form-control" id="targetNumber" runat="server" value=""
                placeholder="tlf. nummer" />
        </div>
        <div class="form-group" style="display:none">
            <label for="DeviceSelectList">
                Vælg device</label>
            <label class="radio-inline">
                <asp:RadioButtonList runat="server" ID="DeviceSelectList" class="radio-inline">
                    <asp:ListItem Text="T" Value="9055" Selected="True"></asp:ListItem>
                    <asp:ListItem Text="M" Value="" Enabled="false"></asp:ListItem>
                </asp:RadioButtonList>
            </label>
        </div>
        <div class="form-group">
            <label for="deviceId">
                Indtast Device ID</label>
            <input type="text" class="form-control" id="deviceIdTb" runat="server" value=""
                placeholder="Device ID" />
        </div>
    </div>
    <br />
    <hr />
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>
                <asp:Repeater runat="server" ID="commandRepeater" OnLoad="commandRepeater_Load">
                    <HeaderTemplate>
                        <table class="table table-striped">
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <%#((CommandObject)Container.DataItem).Title %>
                            </td>
                            <td>
                                <input class="commandTB" runat="server" id="commandTB" type="text" value="<%#((CommandObject)Container.DataItem).Command %>" />
                            </td>
                            <td>
                                <input type="button" runat="server" id="selectCommandCB" value="Send" onserverclick="selectCommandCB_Click" />
                            </td>
                            <td>
                                <asp:Label ID="commandLbl" runat="server" ClientIDMode="Static" Text="<%#((CommandObject)Container.DataItem).Description %>" />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table></FooterTemplate>
                </asp:Repeater>
                <hr />
                <asp:Label ID="ErrorLbl" runat="server" Visible="false"></asp:Label>
                <asp:Literal runat="server" ID="responseLit"></asp:Literal>
                <input id="responseHid" clientidmode="Static" runat="server" type="hidden" />
                <div id="prettyResponseDiv">
                </div>
                <%--<div class="form-group">
            <label for="exampleInputEmail1">
                Email address</label>
            <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email" />
        </div>
        <div class="form-group">
            <label for="exampleInputPassword1">
                Password</label>
            <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password" />
        </div>
        <div class="form-group">
            <label for="exampleInputFile">
                Modtagernummer</label>
            <input type="tel" class="form-control" id="phoneNumber" placeholder="nummer" />
        </div>
        <button type="submit" class="btn btn-default">
            Submit</button>--%>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
        <ProgressTemplate>
            Working...</ProgressTemplate>
    </asp:UpdateProgress>
    </form>
</body>
</html>
